﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;

namespace WinnerCMS.Model
{
    //[Table("CMS_Core")]
    public partial class Core
    {
        public Core()
        {
            ContentComments = new List<Comment>();
            Specials = new List<Special>();
            TagsInfos = new List<Tag>();
            DeputyCategoryes = new List<Category>();
            Diggs = new List<Digg>();

            this.CreateTime = DateTime.Now;
        }
        /// <summary>
        /// Id
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 栏目id
        /// </summary>
        public int CategoryId { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        [Index]
        public string ContentTitle { get; set; }
        /// <summary>
        /// 摘要
        /// </summary>
        public string Brief { get; set; }
        /// <summary>
        /// 样式
        /// </summary>
        public string CssClass { get; set; }
        /// <summary>
        /// 作者
        /// </summary>
        public string Editor { get; set; }
        /// <summary>
        /// 总点击
        /// </summary>
        public int Hits { get; set; }
        /// <summary>
        /// 日点击
        /// </summary>
        public int DayHits { get; set; }
        /// <summary>
        /// 周点击
        /// </summary>
        public int WeekHits { get; set; }
        /// <summary>
        /// 月点击
        /// </summary>
        public int MonthHits { get; set; }
        /// <summary>
        /// 包含图片
        /// </summary>
        public bool IncludePic { get; set; }
        /// <summary>
        /// 缩略图
        /// </summary>
        public string PicUrl { get; set; }
        /// <summary>
        /// 评级
        /// </summary>
        public byte Stars { get; set; }
        /// <summary>
        /// 是否幻灯片展览
        /// </summary>
        public bool IsSlide { get; set; }
        /// <summary>
        /// 是否头条
        /// </summary>
        public bool IsHeadline { get; set; }

        /// <summary>
        /// 推荐
        /// </summary>
        public bool IsElite { get; set; }
        /// <summary>
        /// 置顶
        /// </summary>
        public bool IsOnTop { get; set; }
        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDeleted { get; set; }
        /// <summary>
        /// 是否审核
        /// </summary>
        public bool IsChecked { get; set; }
        /// <summary>
        /// 是否草稿
        /// </summary>
        public bool IsDraft { get; set; }
        /// <summary>
        /// 浏览等级
        /// </summary>
        public short Rank { get; set; }
        /// <summary>
        /// 消费点数
        /// </summary>
        public short PointNum { get; set; }
        /// <summary>
        /// 允许评论
        /// </summary>
        public bool AllowComment { get; set; }
        /// <summary>
        /// 录入时间
        /// </summary>
        public System.DateTime CreateTime { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        public System.DateTime UpdateTime { get; set; }
        /// <summary>
        /// 最后点击
        /// </summary>
        public System.DateTime? LastHitTime { get; set; }
        /// <summary>
        /// 模板
        /// </summary>
        public string TemplateFileName { get; set; }
        /// <summary>
        /// 评论数量
        /// </summary>
        public int CommentQuantity { get; set; }
        /// <summary>
        /// 评论分数
        /// </summary>
        public int CommentScore { get; set; }

        ///// <summary>
        ///// 状态
        ///// </summary>
        //public ContentStatus Status { get; set; }
        /// <summary>
        /// 分类
        /// </summary>
        public virtual Category Category { get; set; }

        /// <summary>
        /// 附属栏目
        /// </summary>
        public virtual ICollection<Category> DeputyCategoryes { get; set; }
        public virtual ICollection<Comment> ContentComments { get; set; }
        public virtual ICollection<Special> Specials { get; set; }
        public virtual ICollection<Tag> TagsInfos { get; set; }

        public virtual ICollection<Digg> Diggs { get; set; }

        #region 静态页地址

        /// <summary>
        /// 静态页地址
        /// </summary> 
        [DataMember, NotMapped]
        public string Link { set; get; }

        #endregion

        #region 栏目IDs
        /// <summary>
        /// 栏目IDs
        /// </summary>
        [DataMember, NotMapped]
        public string CategoryIds { get; set; }

        #endregion

        [DataMember, NotMapped]
        public string Tags { get; set; }
    }
}